package com.example.system.controller.user;

import com.example.common.core.controller.BaseController;
import com.example.common.core.domain.Result;
import com.example.common.core.domain.TableDataInfo;
import com.example.system.domain.user.dto.UserDTO;
import com.example.system.domain.user.dto.UserQueryDTO;
import com.example.system.service.user.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController extends BaseController {
    @Autowired
    private IUserService userService;

    //获取用户列表
    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userQuertDTO){
        return getTableDataInfo(userService.list(userQuertDTO));
    }

    //更新用户的权限//拉黑还是正常状态
    @PutMapping("/updateStatus")
    public Result<Void> updateStatus(@RequestBody UserDTO userDTO){
        return toResult(userService.updateStatus(userDTO));
    }
}
